<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>移动端事件</title>
    <style>
        #ad{
            width: 100%;
            height: 200px;
            background: #eee;
        }
    </style>
</head>
<body>
    <div id="ad"></div>

    <script>
        let ad = document.querySelector('#ad');

        //手指按下
        ad.ontouchstart = function(){
            console.log('你触摸了我');
        }

        //手指滑动
        ad.addEventListener('touchmove', function(){
            console.log('指尖划过');
        });

        //手指离开
        ad.addEventListener('touchend', function(){
            console.log('指尖离开');
        });

        //触摸打断   来电
        ad.addEventListener('touchcancel', function(){
            console.log('触摸被打断啦!!!');
        });

        // setTimeout(() => {
        //     alert('主人, 那家伙又来电话啦!!');
        // }, 5000);

    </script>

</body>
</html>